import b_settings

class Material(object):
	def __init__(self, data, name, area=0.0005, youngsmodulus=20000000000.0, density=7850.0, *arguments, **keywords):
		self.data = data
		self.name = name
		self.area = area
		self.youngsmodulus = youngsmodulus
		self.density = density
	
	def deleteMaterial(self):
		for member in self.data.members.values():
			if member.material is self:
				member.deleteMember()
		del self.data.materials[self.name]
	
	def __repr__(self):
		return "{Material: {name: %s, area: %s, youngsmodulus: %s, density: %s}}" % (self.name, self.area, self.youngsmodulus, self.density)
